package com.zhehekeji.opsys.api.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @ClassName TVoteRegion
 * @Description TODO
 * @author chenweiliu chenwei.liu@163.com
 * @date 2016-7-20   下午4:39:41
 */
@Entity
@Table(name="t_vote_region")
public class TVoteRegion implements java.io.Serializable{
	/** 
	* @Fields serialVersionUID : TODO
	*/ 
	private static final long serialVersionUID = 7447304403258956037L;
	private Long id;
	private String originalCode;
	private String code;
	private String name;
	private Integer sequence;
	private Date createTime;
	private Integer status;
	private Long cpCode;
	private TVoteRegion tvoteRegion;
	
	private Integer voteTimes;
	private Integer voteTimesHd;
	private Integer voteTimes4k;
	
	private Date startTime;
	private Date endTime;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="ID",length=20,nullable=false,unique=true)
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@Column(name="ORIGINAL_CODE",length=64,nullable=true)
	public String getOriginalCode() {
		return originalCode;
	}
	public void setOriginalCode(String originalCode) {
		this.originalCode = originalCode;
	}
	@Column(name="CODE",length=64,nullable=true)
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	@Column(name="NAME",length=128,nullable=true)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name="SEQUENCE",length=11,nullable=true)
	public Integer getSequence() {
		return sequence;
	}
	public void setSequence(Integer sequence) {
		this.sequence = sequence;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="CREATE_TIME")
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@Column(name="STATUS",length=2,nullable=true)
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	@Column(name="CP_CODE",length=20,nullable=true)
	public Long getCpCode() {
		return cpCode;
	}
	public void setCpCode(Long cpCode) {
		this.cpCode = cpCode;
	}
	@ManyToOne(cascade=CascadeType.REFRESH,fetch=FetchType.EAGER,optional=true)
	@JoinColumn(name="PARENT_ID")
	public TVoteRegion getTvoteRegion() {
		return tvoteRegion;
	}
	public void setTvoteRegion(TVoteRegion tvoteRegion) {
		this.tvoteRegion = tvoteRegion;
	}
	@Column(name="VOTE_TIMES",length=11,nullable=true)
	public Integer getVoteTimes() {
		return voteTimes;
	}

	public void setVoteTimes(Integer voteTimes) {
		this.voteTimes = voteTimes;
	}
	@Column(name="VOTE_TIMES_HD",length=11,nullable=true)
	public Integer getVoteTimesHd() {
		return voteTimesHd;
	}

	public void setVoteTimesHd(Integer voteTimesHd) {
		this.voteTimesHd = voteTimesHd;
	}
	@Column(name="VOTE_TIMES_4K",length=11,nullable=true)
	public Integer getVoteTimes4k() {
		return voteTimes4k;
	}

	public void setVoteTimes4k(Integer voteTimes4k) {
		this.voteTimes4k = voteTimes4k;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="START_TIME")
	public Date getStartTime() {
		return startTime;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="END_TIME")
	public Date getEndTime() {
		return endTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
}

